package com.chaoxuan.uebt.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.chaoxuan.uebt.R;
import com.chaoxuan.uebt.model.News;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

/**
 * Created by Administrator on 2019/5/24.
 */
public class InfoAdapter extends BaseQuickAdapter<News,BaseViewHolder>{

    public InfoAdapter() {
        super(R.layout.fragment_info_item);
    }

    @Override
    protected void convert(BaseViewHolder helper, News item) {
        Glide.with(mContext).load(item.getImg()).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).placeholder(R.mipmap.default_info).error(R.mipmap.default_info).into((ImageView) helper.getView(R.id.img_info));
        helper.setText(R.id.tv_info_title, item.getTitle());
        helper.setText(R.id.tv_info_time,"发布时间:"+item.getPublish_time());
    }
}
